﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TechTree.Stalk.Roots.Database
{
    public abstract class DatabaseContext
    {
        public string ConnectionString { get; set; }

        #region Abstract Functions
        public abstract IDbConnection CreateConnection();
        public abstract IDbCommand CreateCommand();
        public abstract IDbConnection CreateOpenConnection();
        public abstract IDbCommand CreateCommand(string commandText, IDbConnection connection);
        public abstract IDbCommand CreateStoredProcCommand(string procName, IDbConnection connection);
        public abstract IDataParameter CreateParameter(string parameterName, object parameterValue);
        public abstract IDataParameter CreateParameter(string parameterName, DbType dbType, object value);
        public abstract IDataParameter CreateParameter(string parameterName, DbType dbType, int size, object value);
        public abstract IDataParameter CreateParameter(string parameterName, DbType dbType, int size, string sourceColumn, object value);
        public abstract IDataParameter CreateParameter(string parameterName, DbType dbType, int size, ParameterDirection direction, bool isNullable, string sourceColumn, DataRowVersion sourceVersion, object value);
        #endregion
    }
}
